package com.springboot.demo.design.pattern.observer;

import java.util.Observable;
import java.util.Observer;

/**
 * 账户观察者
 *
 * @author supu
 * @date 2019-07-17 13:36
 **/
public class AccountWatcher implements Observer {
    @Override
    public void update(Observable o, Object arg) {
        OrderInfo orderInfo = (OrderInfo) arg;

        System.out.println("userId:" + orderInfo.getUserId() + " 账户更新了 " + orderInfo.getMoney() + " 元");
    }
}
